package com.ellwood.copyright.common.core.enums;

import lombok.Getter;

/**
 * @ProjectName: ell-copyright-pro
 * @PackageName: com.ellwood.copyright.common.core.enums
 * @ClassName: HttpCodeEnum
 * @Description: // 返回状态消息
 * @Author: Ellwood
 * @CreateDate: 2024/11/12 - 11:15
 * @Version: V1.0.0
 */
@Getter
public enum HttpCodeEnum {
    // 成功
    SUCCESS(200, "操作成功"),

    NOT_MODIFIED(304,"资源没有被修改"),

    ERROR(400, "请求失败"),

    // 登录
    NEED_LOGIN(401, "请先登录"),
    REFRESH_TOKEN_INVALID(402 , "refresh_token 已失效"),
    NO_OPERATOR_AUTH(403, "无权限操作"),
    QUERY_DATA_NULL(404, "查询数据为空"),
    QUERY_DATA_NOT_EXIST(405, "查询数据不存在"),

    SYSTEM_ERROR(500, "出现错误"),
    SYSTEM_TIMEOUT(501, "系统超时"),
    SERVICE_ERROR(502, "服务异常"),
    SERVICE_UNAVAILABLE(503, "服务不可用"),
    BAD_REQUEST(504, "请求参数错误"),

    USERNAME_EXIST(1001, "用户名已存在"),
    MOBILE_NUMBER_EXIST(1002, "手机号已存在"),
    MOBILE_NUMBER_NOT_NULL(1003, "手机号不能为空"),
    EMAIL_EXIST(1004, "邮箱已存在"),
    REQUIRE_USERNAME(1005, "必需填写用户名"),
    USERNAME_NOT_NULL(1006, "用户名不能为空"),
    PASSWORD_NOT_NULL(1007, "密码不能为空"),
    EMAIL_NOT_NULL(1008, "邮箱不能为空"),

    // 数据表创建
    DATA_TABLE_CREATE_SUCCESS(2001,"创建成功"),
    SQL_EXECUTE_ERROR(2002,"执行 SQL 失败"),
    DATA_TABLE_CREATE_ERROE(2004,"创建失败"),

    // 导入导出
    data_export_failed(3002,"导出数据失败"),
    data_export_success(3001,"导出数据成功"),
    data_import_failed(3004,"导入数据失败"),
    data_import_success(3003,"导入数据成功"),
    ;

    private final Integer code;
    private final String message;

    HttpCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}
